fix(table): virtualized table in firefox by replacing Spacer with css#5963
Conversation
🦋 Changeset detectedLatest commit: eaa4fab The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
WalkthroughRemoves the Spacer component dependency from the table component by replacing it with CSS pseudo-elements for spacing. The Spacer component is deleted from both virtualized and non-virtualized table implementations, with CSS styling added to the theme configuration to provide equivalent spacing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10-15 minutes
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/core/theme/src/components/table.ts (1)
57-58: CSS-based header/body gap viathead::afterlooks soundUsing
after:content-[''] after:table-row after:h-[5px]ontheadis consistent with your existingcontent-['']usage and should avoid the Firefox virtualization issues caused by a real Spacer row, while still preserving the visual gap. As an optional follow-up, consider documenting how consumers can remove this gap (e.g. viaclassNames.theadwithafter:content-none) to fully address the customization concerns from #2108.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.changeset/brown-taxis-share.md(1 hunks)packages/components/table/package.json(1 hunks)packages/components/table/src/table.tsx(0 hunks)packages/components/table/src/virtualized-table.tsx(0 hunks)packages/core/theme/src/components/table.ts(1 hunks)
💤 Files with no reviewable changes (2)
- packages/components/table/src/table.tsx
- packages/components/table/src/virtualized-table.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: ESLint
- GitHub Check: Build
- GitHub Check: TypeScript
- GitHub Check: Continuous Release
🔇 Additional comments (1)
.changeset/brown-taxis-share.md (1)
1-6: Changeset accurately describes the scope of the fixThe packages and message line up with the actual change (table + theme patch for Firefox virtualized table via CSS spacer), so this is good to ship as-is.
@heroui/accordion
@heroui/alert
@heroui/autocomplete
@heroui/avatar
@heroui/badge
@heroui/breadcrumbs
@heroui/button
@heroui/calendar
@heroui/card
@heroui/checkbox
@heroui/chip
@heroui/code
@heroui/date-input
@heroui/date-picker
@heroui/divider
@heroui/drawer
@heroui/dropdown
@heroui/form
@heroui/image
@heroui/input
@heroui/input-otp
@heroui/kbd
@heroui/link
@heroui/listbox
@heroui/menu
@heroui/modal
@heroui/navbar
@heroui/number-input
@heroui/pagination
@heroui/popover
@heroui/progress
@heroui/radio
@heroui/ripple
@heroui/scroll-shadow
@heroui/select
@heroui/skeleton
@heroui/slider
@heroui/snippet
@heroui/spacer
@heroui/spinner
@heroui/switch
@heroui/table
@heroui/tabs
@heroui/toast
@heroui/tooltip
@heroui/user
@heroui/react
@heroui/system
@heroui/system-rsc
@heroui/theme
@heroui/aria-utils
@heroui/dom-animation
@heroui/framer-utils
@heroui/react-rsc-utils
@heroui/react-utils
@heroui/shared-icons
@heroui/shared-utils
@heroui/stories-utils
@heroui/test-utils
@heroui/use-aria-accordion
@heroui/use-aria-accordion-item
@heroui/use-aria-button
@heroui/use-aria-link
@heroui/use-aria-modal-overlay
@heroui/use-aria-multiselect
@heroui/use-aria-overlay
@heroui/use-callback-ref
@heroui/use-clipboard
@heroui/use-data-scroll-overflow
@heroui/use-disclosure
@heroui/use-draggable
@heroui/use-form-reset
@heroui/use-image
@heroui/use-infinite-scroll
@heroui/use-intersection-observer
@heroui/use-is-mobile
@heroui/use-is-mounted
@heroui/use-measure
@heroui/use-pagination
@heroui/use-real-shape
@heroui/use-ref-state
@heroui/use-resize
@heroui/use-safe-layout-effect
@heroui/use-scroll-position
@heroui/use-ssr
@heroui/use-theme
@heroui/use-update-effect
@heroui/use-viewport-size
commit: |
📝 Description
Spacer was used to add the spaces between the table header and body since applying margin to tr won't take any effect. However, using spacer would break virtualized table in firefox. Hence, this PR is to replace the spacer by css (adopting react-aria approach).
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
📝 Additional Information
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.